<?php
set_time_limit(0);
include("AllWeb.inc.php");

$arrGroup = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);
foreach($arrWeb as $strWeb){
	if($strWeb == "luckyball.cc")continue;
	if($strWeb == "3d.usbet33.us")continue;

	print $strWeb."\n";
	print "=======================================\n";

	$_SERVER["DOCUMENT_ROOT"] = "/home/share/www/".$strWeb."/secure";
	include($_SERVER["DOCUMENT_ROOT"]."/db.inc.php");

	$strSQL = "select COUNT(*) as TotalNo, MemberGroup from `bet_Member` where isLock = '0' and MemberGroup in (1,2,3,4,5) group by MemberGroup order by MemberGroup";

	if(!$RS = mysql_query($strSQL, $$_Conn)){
		$GLOBALS["errormessage"] = "Find Member Data Error!";
		$GLOBALS["errorhidden"] = "SQL: ".$strSQL.", \nError: ".mysql_error($$_Conn).", \nLine: ".__LINE__.", \nPage: ".__FILE__;
		include($_SERVER["DOCUMENT_ROOT"]."/error.php");
		exit();
	}

	while($Rows = mysql_fetch_object($RS)){
		print $Rows -> MemberGroup." = ".$Rows -> TotalNo."\n";
		$arrGroup[$Rows -> MemberGroup] += $Rows -> TotalNo;
	}
	print "\n\n\n";
}

print "總計\n";
print "=======================================\n";
foreach($arrGroup as $intGroup => $intTotalNo){
	print $intGroup." = ".$intTotalNo."\n";
}
print $arrGroup[1]+$arrGroup[2]+$arrGroup[3]+$arrGroup[4]+$arrGroup[5];
?>